﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using VioletDevelopmentLaboratory.Net.Web;

public partial class vboard_membership_findusername : VioletDevelopmentLaboratory.Net.Web.PageBase
{
	protected void Page_Init(object sender, EventArgs e)
	{
		Page.Header.Title = GetLocalResourceObject("Title").ToString();
	}

	protected void Page_Load(object sender, EventArgs e)
	{
	}

	protected void FindUserNameButton_Click(object sender, EventArgs e)
	{
		if (Page.IsValid)
		{
			String username = Membership.GetUserNameByEmail(EmailTextBox.Text);

			if (String.IsNullOrEmpty(username))
			{
				VUtility.ShowMessagePanel(Page, VUtility.GetVWebGlobalResource("Membership_Do_FindUserName_Failure"), true);
				return;
			}

			EmailTextBox.Text = "";
			username = username.Substring(0, username.Length - 2) + "**";
			VUtility.ShowMessagePanel(Page, String.Format(VUtility.GetVWebGlobalResource("Membership_Do_FindUserName_Success"), username), true);
		}
	}
}